package com.irdstudio.apicenter.gateway.comm.format;

import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Component;

/**
 * 格式化：格式化空值
 * 	   如果为空，返回param指定的值
 *   否则返回原值
 * @author zs.ligm
 * @version 1.0
 * @date 2015-08-05
 */
@Component(value="TDFormatNull")
public class TDFormatNull implements ITDFormat {

	@Override
	public String format(String srcValue, String param) {
		if(StringUtils.isEmpty(srcValue)){
			return param;
		} else {
			return srcValue;
		}
	}

}
